package com.changgou.goods.service.impl;

import com.changgou.goods.service.OrderService;
import entity.IdWorker;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private RabbitTemplate rabbitTemplate;


    public void makeOrfer(Map<String,Object> map){
        String orderId = new IdWorker(0,0).nextId()+"";

        String exchangeName = "fanout_order_exchange";
        String routingkey = "";
        rabbitTemplate.convertAndSend(exchangeName,routingkey,orderId);
    }
}
